/**
 * @filename: OrderFactory.java 2020年1月13日
 * @project match-service  V1.0
 * Copyright(c) 2020 flying-cattle Co. Ltd. 
 * All right reserved. 
 */
package com.service.socket.service;

import com.service.dao.enums.KlineTypeEnum;
import org.springframework.util.Assert;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @ClassName: OrderFactory
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author flying-cattle
 * @date 2020年1月13日
 */
public class KlineServiceFactory {
	private static Map<KlineTypeEnum, KlineService> services = new ConcurrentHashMap<>();

	public static KlineService getByType(KlineTypeEnum klineType) {
		return services.get(klineType);
	}

	public static void register(KlineTypeEnum klineTypeEnum, KlineService klineService) {
		Assert.notNull(klineTypeEnum, "userType can't be null");
		services.put(klineTypeEnum, klineService);
	}
}
